c_matrix4x4::c_matrix4x4(const c_matrix4x4& mat)
{
	*this = mat; 
}

c_matrix4x4::c_matrix4x4(const D3DXMATRIX& mat)
{
    *this = mat; 
}

c_matrix4x4::c_matrix4x4(const float *values)
    : D3DXMATRIX(values)
{
}

c_matrix4x4::c_matrix4x4(float _11, float _12, float _13, float _14,
                         float _21, float _22, float _23, float _24,
                         float _31, float _32, float _33, float _34,
                         float _41, float _42, float _43, float _44 )
{
}

c_matrix4x4 c_matrix4x4::Identity()
{
    c_matrix4x4 identity;
    D3DXMatrixIdentity(&identity);
    return identity;
}

void c_matrix4x4::transpose()
{
    D3DXMATRIX mat; 
    D3DXMatrixTranspose(&mat, this); 
    *this = mat; 
}

void c_matrix4x4::inverse()
{
    D3DXMATRIX mat; 
    D3DXMatrixInverse(&mat, NULL, this); 
    *this = mat; 
}

c_matrix4x4& c_matrix4x4::operator = (const D3DXMATRIX& arg)
{
    if (this == &arg) 
        return *this; 
	
	::memcpy_s(this, sizeof(D3DXMATRIX), &arg, sizeof(D3DXMATRIX));

	return *this; 
}

c_matrix4x4 c_matrix4x4::operator * (const c_matrix4x4& arg) const
{
    c_matrix4x4 result = c_matrix4x4::Identity();
    D3DXMatrixMultiply(&result, this, &arg);
    return result;
}